package com.qrpcw.algorithms;
import java.util.Arrays;


public class BubbleSort {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		BubbleSort test = new BubbleSort();
		int[] a = new int[]{2,35,31,3,21,17,19,26,25,33};
		test.bubbleSort(a);
		System.out.println(Arrays.toString(a));
	}
	
	public void bubbleSort(int[] a){
		int i,j,temp;
		for(i=0; i<a.length; i++){
			for(j=1; j<a.length-i;j++){
				if(a[j-1] < a[j]){
					temp = a[j-1];
					a[j-1] = a[j];
					a[j] = temp;
				}
			}
		}
	}
}
